/*
 * DColor.java
 *
 * Created on 18 de Fevereiro de 2005, 00:52
 */

package Janelas;

/**
 *
 * @author  Gustavo
 */
public class DColor extends javax.swing.JDialog {
    
    /** Creates new form DColor */
    public DColor(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        Cor = java.awt.Color.BLACK;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        CCCor = new javax.swing.JColorChooser();
        PSul = new javax.swing.JPanel();
        BOK = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().add(CCCor, java.awt.BorderLayout.CENTER);

        PSul.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        PSul.setBorder(new javax.swing.border.TitledBorder(""));
        BOK.setText("OK");
        BOK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BOKActionPerformed(evt);
            }
        });

        PSul.add(BOK);

        getContentPane().add(PSul, java.awt.BorderLayout.SOUTH);

        pack();
    }//GEN-END:initComponents

    private void BOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BOKActionPerformed
        // TODO add your handling code here:
        this.dispose();
        Cor = CCCor.getColor();
    }//GEN-LAST:event_BOKActionPerformed

    public java.awt.Color getCor() {
        return Cor;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BOK;
    public javax.swing.JColorChooser CCCor;
    private javax.swing.JPanel PSul;
    // End of variables declaration//GEN-END:variables
    private java.awt.Color Cor;
}
